package gui;

import java.util.LinkedList;

public class PublicOrdersList {

	private LinkedList<Order> publicOrders;

	public PublicOrdersList() {
		publicOrders = new LinkedList();
	}

	public Order getOrder(int orderIndex) {
		return publicOrders.get(orderIndex);
	}

	public int removeOrder(int serverOrderId) {
		int count = 0;
		for (Order order : publicOrders) {
			if (order.getServerOrderID() == serverOrderId) {
				publicOrders.remove(order);
				return count;
			}
			count++;
		}
		return -1;
	}

	public int getLenght() {
		return publicOrders.size();
	}

}
